package transaction

import "bytes"

/**
 *@author:zhengyilong
 *@email:1797344574@qq.com
 *@phone:13479394730
 *@DateTime:2022/4/18 15:39
 **/

type Input struct {
	TXid []byte
	Vout int
	ScriptSig []byte
}

func NewInput(txid []byte, vout int, scriptSig []byte) Input {
	return Input{txid,vout,scriptSig}
}

//判断input是某个人的消费
func (input *Input) Islocked(name string) bool {
	if name == "" {
		return false
	}
	return bytes.Compare(input.ScriptSig,[]byte(name)) == 0
}